<link rel="import" href="../../../html/polymer.html">

<link rel="import" href="../../../html/i18n_behavior.html">
<link rel="import" href="base_page.html">
<link rel="import" href="cellular_setup_delegate.html">
<link rel="import" href="../../../cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">

<dom-module id="setup-loading-page">
  <template>
    <style include="iron-flex cr-hidden-style">
      paper-spinner-lite {
        height: 32px;
        margin-bottom: 8px;
        width: 32px;
      }

      #simDetectError {
        background-image: url(chrome://resources/cr_components/chromeos/cellular_setup/sim_detect_error.svg);
        background-position: center center;
        background-repeat: no-repeat;
        background-size: contain;
        height: 100%;
        width: 100%;
      }

      #networkConnectionMessage {
        text-align: center;
      }
    </style>
    <base-page title="[[getTitle_(state)]]"
        message="[[getMessage_(state)]]"
        message-icon="[[getMessageIcon_(state)]]">
      <div slot="page-body" class="layout vertical center-center">
        <paper-spinner-lite active hidden$="[[shouldShowSimDetectError_(state)]]">
        </paper-spinner-lite>
        <div id="networkConnectionMessage" hidden$="[[shouldShowSimDetectError_(state)]]">
          [[loadingMessage]]
        </div>
        <div id="simDetectError" hidden$="[[!shouldShowSimDetectError_(state)]]"></div>
      </div>
    </base-page>
  </template>
  <script src="setup_loading_page.js"></script>
</dom-module>
